<?php
    $buildingName=$_GET['build'];
    $cls=$_GET['class'];
    $par="$buildingName"."$cls";
    $par=base64_encode($par);
	#echo $par;
// 	echo $cls;
// 	echo "<br>";
// 	echo $buildingName;
    // $path="python script_distribution.py $buildingName $cls";
    // $path="python3 /www/wwwroot/bklx/test.py " . "$buildingName $cls";
    // $last_line = system($path,$retval);
    
    exec("python3 /www/wwwroot/web/request/script_distribution.py $par",$array,$ret);
    // print_r($array);
    // echo("<br>");
    // echo("ret is $ret");
    // echo $last_line;
    // echo "<br>";
    // echo $retval;
    #passthru($path);
    #@imagecreatefromjpeg("images/flower_1.jpg");
    //$img=imagecreatefromjpeg("/tempImg/36492.jpg");
    

    

    header('Content-type: image/jpeg');
    $file="$array[0].jpg";
    $img=imagecreatefromjpeg($file);
    
    //$img=imagecreatefromjpeg("/tempImg/$array[0].jpg");
    imagejpeg($img);
    imagedestroy($img);
    unset($img);
    unlink("$array[0].jpg")
    // header("location:/tempImg/$array[0].jpg");
    // unlink("/tempImg/$array[0].jpg");
?>